#!/bin/sh

source ./.env

docker stop $DOCKER_IMAGE_NAME
docker rm   $DOCKER_IMAGE_NAME

#x86
docker run --rm \
  --name $DOCKER_IMAGE_NAME \
  -e BUILD_PROJECT=oceanbase \
  -e BUILD_ARCH=amd64 \
  -e BUILD_SOURCE=internal/plugins/externals/oceanbase/oceanbase.go \
  -e BUILD_DEST=dist/datakit-linux-amd64/externals/oceanbase \
  -v /root/gopath/src:/tmp/gopath/src \
  $DOCKER_IMAGE_NAME:$DOCKER_IMAGE_TAG

#arm
# docker run --rm \
#   --name $DOCKER_IMAGE_NAME \
#   -e BUILD_PROJECT=oceanbase \
#   -e BUILD_ARCH=arm64 \
#   -e BUILD_SOURCE=internal/plugins/externals/oceanbase/oceanbase.go \
#   -e BUILD_DEST=dist/datakit-linux-arm64/externals/oceanbase \
#   -v /root/gopath/src:/tmp/gopath/src \
#   $DOCKER_IMAGE_NAME:$DOCKER_IMAGE_TAG
